package com.ymttest.database.mapping.godmch;

import com.ymttest.database.model.godmch.buyer_invite_code;
import com.ymttest.database.model.godmch.buyer_invite_codeExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface buyer_invite_codeMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table buyer_invite_code
     *
     * @mbggenerated Tue Jun 02 14:28:15 CST 2020
     */
    @SelectProvider(type=buyer_invite_codeSqlProvider.class, method="countByExample")
    int countByExample(buyer_invite_codeExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table buyer_invite_code
     *
     * @mbggenerated Tue Jun 02 14:28:15 CST 2020
     */
    @DeleteProvider(type=buyer_invite_codeSqlProvider.class, method="deleteByExample")
    int deleteByExample(buyer_invite_codeExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table buyer_invite_code
     *
     * @mbggenerated Tue Jun 02 14:28:15 CST 2020
     */
    @Delete({
        "delete from buyer_invite_code",
        "where userId = #{userId,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer userId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table buyer_invite_code
     *
     * @mbggenerated Tue Jun 02 14:28:15 CST 2020
     */
    @Insert({
        "insert into buyer_invite_code (userId, userType, ",
        "inviteCode, codeStatus, ",
        "remark, createTime, ",
        "updateTime)",
        "values (#{userId,jdbcType=INTEGER}, #{userType,jdbcType=INTEGER}, ",
        "#{inviteCode,jdbcType=VARCHAR}, #{codeStatus,jdbcType=INTEGER}, ",
        "#{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{updateTime,jdbcType=TIMESTAMP})"
    })
    int insert(buyer_invite_code record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table buyer_invite_code
     *
     * @mbggenerated Tue Jun 02 14:28:15 CST 2020
     */
    @InsertProvider(type=buyer_invite_codeSqlProvider.class, method="insertSelective")
    int insertSelective(buyer_invite_code record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table buyer_invite_code
     *
     * @mbggenerated Tue Jun 02 14:28:15 CST 2020
     */
    @SelectProvider(type=buyer_invite_codeSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="userId", property="userId", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="userType", property="userType", jdbcType=JdbcType.INTEGER),
        @Result(column="inviteCode", property="inviteCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="invitePicUrl", property="invitePicUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="codeStatus", property="codeStatus", jdbcType=JdbcType.INTEGER),
        @Result(column="remark", property="remark", jdbcType=JdbcType.VARCHAR),
        @Result(column="createTime", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="updateTime", property="updateTime", jdbcType=JdbcType.TIMESTAMP)
    })
    List<buyer_invite_code> selectByExample(buyer_invite_codeExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table buyer_invite_code
     *
     * @mbggenerated Tue Jun 02 14:28:15 CST 2020
     */
    @Select({
        "select",
        "userId, userType, inviteCode, invitePicUrl,codeStatus, remark, createTime, updateTime",
        "from buyer_invite_code",
        "where userId = #{userId,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="userId", property="userId", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="userType", property="userType", jdbcType=JdbcType.INTEGER),
        @Result(column="inviteCode", property="inviteCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="invitePicUrl", property="invitePicUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="codeStatus", property="codeStatus", jdbcType=JdbcType.INTEGER),
        @Result(column="remark", property="remark", jdbcType=JdbcType.VARCHAR),
        @Result(column="createTime", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="updateTime", property="updateTime", jdbcType=JdbcType.TIMESTAMP)
    })
    buyer_invite_code selectByPrimaryKey(Integer userId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table buyer_invite_code
     *
     * @mbggenerated Tue Jun 02 14:28:15 CST 2020
     */
    @UpdateProvider(type=buyer_invite_codeSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") buyer_invite_code record, @Param("example") buyer_invite_codeExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table buyer_invite_code
     *
     * @mbggenerated Tue Jun 02 14:28:15 CST 2020
     */
    @UpdateProvider(type=buyer_invite_codeSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") buyer_invite_code record, @Param("example") buyer_invite_codeExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table buyer_invite_code
     *
     * @mbggenerated Tue Jun 02 14:28:15 CST 2020
     */
    @UpdateProvider(type=buyer_invite_codeSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(buyer_invite_code record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table buyer_invite_code
     *
     * @mbggenerated Tue Jun 02 14:28:15 CST 2020
     */
    @Update({
        "update buyer_invite_code",
        "set userType = #{userType,jdbcType=INTEGER},",
          "inviteCode = #{inviteCode,jdbcType=VARCHAR},",
          "invitePicUrl = #{invitePicUrl,jdbcType=VARCHAR},",
          "codeStatus = #{codeStatus,jdbcType=INTEGER},",
          "remark = #{remark,jdbcType=VARCHAR},",
          "createTime = #{createTime,jdbcType=TIMESTAMP},",
          "updateTime = #{updateTime,jdbcType=TIMESTAMP}",
        "where userId = #{userId,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(buyer_invite_code record);
}